/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.click.app.dao.hibernate;

import com.click.app.dao.AsistanceControlDao;
import com.click.app.model.AsistanceControl;
import com.click.app.model.Employee;
import java.util.Date;
import java.util.List;

/**
 *
 * @author org.@le
 */
public class AsistanceControlDaoHibernate extends GenericDaoHibernate<AsistanceControl, Long> implements AsistanceControlDao{

    public AsistanceControlDaoHibernate() {
        super(AsistanceControl.class);
    }

    public List<AsistanceControl> findByEmployee(Employee employee) {
        return getHibernateTemplate().find("from AsistanceControl where employee=? order by date", employee);
    }

    public List<AsistanceControl> findByEmployeePeriod(Employee employee, Date initDate, Date endDate) {
        Object[] objects = {employee, initDate, endDate};
        return getHibernateTemplate().find("from AsistanceControl where employee=? and date Between ? And ? ", objects);
    }
}
